#ifndef P2P_CLIENT_MYSOCKET_H_
#define P2P_CLIENT_MYSOCKET_H_

#include "proto.h"
#include "myUser.h"
#include "mainGUI.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <unistd.h>
#include <signal.h>
#include <pthread.h>

#define CLEN_PORT 8888

extern char flag; 
extern int sockfd;
extern int listenfd;
extern struct sockaddr_in sockAddr, listenAddr;
extern char buf[BUF_SIZE];
extern char myUID[LEN];
extern struct msgHead msgh;

extern void writeMsg(int fd, msgHead *HeadMsg, char *buf);
extern void readMsg(int fd, msgHead *HeadMsg, char *buf);
extern int init(int port, char *IP, SAI *addr);
extern void tellMessage(char *);
extern void sendMessage(char *, char *);
extern void *p2pFunc(void *arg);
extern void *Listen(void *arg);
extern void err_sys(const char *s);

#endif
